package ltd.cheers.mall.service;

import ltd.cheers.mall.controller.vo.CheersMallOrderDetailVO;
import ltd.cheers.mall.controller.vo.CheersMallOrderItemVO;
import ltd.cheers.mall.controller.vo.CheersMallShoppingCartItemVO;
import ltd.cheers.mall.controller.vo.CheersMallUserVO;
import ltd.cheers.mall.entity.CheersMallOrder;
import ltd.cheers.mall.util.PageQueryUtil;
import ltd.cheers.mall.util.PageResult;

import java.util.List;

/**
 * @author: LiHuanYang
 * @date: 2020/3/25 下午 11:43
 */
public interface CheersMallOrderService {
    /**
     * 后台分页
     *
     * @param pageUtil
     * @return
     */
    PageResult getCheersMallOrdersPage(PageQueryUtil pageUtil);

    /**
     * 订单信息修改
     *
     * @param cheersMallOrder
     * @return
     */
    String updateOrderInfo(CheersMallOrder cheersMallOrder);

    /**
     * 配货
     *
     * @param ids
     * @return
     */
    String checkDone(Long[] ids);

    /**
     * 出库
     *
     * @param ids
     * @return
     */
    String checkOut(Long[] ids);

    /**
     * 关闭订单
     *
     * @param ids
     * @return
     */
    String closeOrder(Long[] ids);

    /**
     * 保存订单
     *
     * @param user
     * @param myShoppingCartItems
     * @return
     */
    String saveOrder(CheersMallUserVO user, List<CheersMallShoppingCartItemVO> myShoppingCartItems);

    /**
     * 获取订单详情
     *
     * @param orderNo
     * @param userId
     * @return
     */
    CheersMallOrderDetailVO getOrderDetailByOrderNo(String orderNo, Long userId);

    /**
     * 获取订单详情
     *
     * @param orderNo
     * @return
     */
    CheersMallOrder getCheersMallOrderByOrderNo(String orderNo);

    /**
     * 我的订单列表
     *
     * @param pageUtil
     * @return
     */
    PageResult getMyOrders(PageQueryUtil pageUtil);

    /**
     * 手动取消订单
     *
     * @param orderNo
     * @param userId
     * @return
     */
    String cancelOrder(String orderNo, Long userId);

    /**
     * 确认收货
     *
     * @param orderNo
     * @param userId
     * @return
     */
    String finishOrder(String orderNo, Long userId);

    String paySuccess(String orderNo, int payType);

    List<CheersMallOrderItemVO> getOrderItems(Long id);

    /**
     * 通过userId获取订单详情
     *
     * @param userId
     * @return
     */
    List<CheersMallOrder> getCheersMallOrderByUserId(String userId);

    /**
     * 通过userId获取交易完成订单详情
     *
     * @param userId
     * @return
     */
    List<CheersMallOrder> getCheersMallFinishOrderByUserId(String userId);

    /**
     * 通过订单状态获取订单详情
     *
     * @param orderStatus
     * @return
     */
    List<CheersMallOrder> getCheersMallOrderByOrderStatus(int orderStatus);

}
